
#ifndef FXT_SERVER_SESSION_HPP__
# define FXT_SERVER_SESSION_HPP__

# ifndef _WIN32_WINNT
#  define _WIN32_WINNT 0x0501
# endif // _WIN32_WINNT

#include <cstddef>
#include <array>

#include <boost/asio.hpp>

static std::size_t const bufferSize = 1024;

namespace Fxt {
	namespace Server {
		class Server;

		class Session {
		public:
			Session(Server & server);
			virtual ~Session();

		public:
			void start();

		private:
			void _startRead();
			void _handleRead(boost::system::error_code const & error, std::size_t bytesTransferred);

		public:
			boost::asio::ip::tcp::socket & socket();

		private:
			Server& _server;
			boost::asio::ip::tcp::socket _socket;
			char _buffer[bufferSize];
		};
	}
}

#endif // FXT_SERVER_SESSION_HPP__